chdkfandomcom-20200222-history
DNG4PS-2/Build from source (Windows)
DNG for PowerShot-2 (DNG4PS-2) sources are publicly available on the DNG4PS-2 homepage. The build advice below is based upon conversations with the author and experience with: * Visual C++ 2008 Express * DNG4PS-2 beta release 0.2.3-beta12 (24.07.2008) * Windows XP SP2. = Pre-Requisites = The readme_en.txt files lists a number of pre-requisites # wxWidgets library (http://www.wxwidgets.org/). # Boost library (http://www.boost.org/) # RAD tool "Code::Blocks" (http://www.codeblocks.org/). Newest nightly build are required # If you want to compile under MS Windows, install MinGW (CGG compiler for Windows) with gettext module (http://www.mingw.org/). In practice the last two pre-requisites are not mandatory. They are only required when performing GUI modifications or building executables for non-Windows platforms. On Windows the program can be built using Visual C++ 2008 Express, Boost and wxWidgets. = Build Libraries = Boost The Boost C++ Libraries can be downloaded from here. Current version at time of writing was v1.35.0, with a download size of ~42mb, unpack/build size of ~220Mb, and install size of ~44Mb (include files and libraries). Instructions on this site are straightforward, though the patching step (for VC++ 2008 Express compatibility) is no longer required with v1.35.0. An adaptation of the key steps follows: In a command prompt execute the following: "%VS90COMNTOOLS%vsvars32.bat" REM Change BOOSTROOT to reflect unpack directory for the zip SET BOOSTROOT=C:\temp\boost_1_35_0 REM Build bjam build program cd /d "%BOOSTROOT%\tools\jam\src" build.bat REM Build Boost libraries then install cd /d "%BOOSTROOT%" tools\jam\src\bin.ntx86\bjam.exe REM Change the value of the --prefix option to the location to install Boost tools\jam\src\bin.ntx86\bjam.exe install --prefix=c:\boost_1_35_0\ wxWidgets The wxWidgets library can be downloaded from here. Current version at time of writing was v2.8.7 and the preferred release is wxAll, with a download size of 18mb, unpack/build size of 2.11Gb (!!!), and install size of ~121Mb (include files and libraries). Instructions on this site are straightforward, though need to be modified slightly to build the unicode versions of the libraries. An adaptation of the key steps follows: In a command prompt execute the following: "%VS90COMNTOOLS%vsvars32.bat" REM Change to reflect unpack location for the zip cd /d "c:\temp\wxWidgets-2.8.7\build\msw\" nmake -f makefile.vc BUILD=debug UNICODE=1 nmake -f makefile.vc BUILD=release UNICODE=1 Copy the include and lib subdirectories to a final location to finish the installation process. Note: : By default the wxWidget library will be built using the Multi-threaded DLL runtime library. DNG4PS-2 is built using the Multi-threaded runtime library. The configuration of one of these two projects must be changed so both use the same runtime library, or errors such as the following will be encountered during linking: msvcrt.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in libcmt.lib(malloc.obj) = Build Program = Download the source files from the DNG4PS-2 homepage and unpack. Create a text file called boost.vsprops and paste in the text below: # Open the DNG4PS-2 project by double clicking on the DNG4PS-2.sln file. # Right click on the DNG4PS-2 project in the tree view. # Select Properties. # For each configuration (debug and release) in the Configuration drop down list. ## Navigate to Configuration Properties -> C/C++ -> Code Generation in the tree view. ## Change the value of the Runtime Library setting to Multi-threaded DLL (/MD). ## Navigate to Configuration Properties -> Linker -> Input in the tree view. ## Remove libcmt.lib from the value of the Additional Dependencies setting. ## Select Apply. # Select OK. # Open the Property Manager using the View -> Property Manager menu item # Right click on the DNG4PS-2 project in the tree view. # Select Add Existing Property Sheet. # In the file dialog, open the boost property sheet created above, then select OK. # Close Visual C++ 2008 Express and save changes to the solution and project files when prompted. In a command prompt execute the following: "%VS90COMNTOOLS%vsvars32.bat" REM Change environment variables to reflect install location for the libraries SET WX=c:\wxWidgets-2.8.7\ SET BOOST=c:\boost_1_35_0\ "%VS90COMNTOOLS%..\..\VC\vcpackages\vcbuild.exe" DNG4PS-2.sln "Release|Win32" Note: : Project configuration changed to use the Multi-threaded DLL runtime library and remove libcmt.lib, to prevent errors such as the following during linking: msvcrt.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in libcmt.lib(malloc.obj) Category:Related ProgramsCategory:Development